package cn.fan.testfunction.service;

import com.alibaba.fastjson.JSONObject;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Header;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;

import java.util.Map;

public interface AmapClient {

    /**
     * 聪明的你一定看出来了@Get注解代表该方法专做GET请求
     * 在url中的{0}代表引用第一个参数，{1}引用第二个参数
     */
    @Get("http://ditu.amap.com/service/regeo?longitude={0}&latitude={1}")
    Map getLocation(String longitude, String latitude);

    @Post("http://172.18.100.157:8010/Web/Login?phone=18688888888&password=123456")
    JSONObject getLogin();

    @Get("http://172.18.100.157:8010/Product/ModifyProModForApp?cProNo={0}&cProName={1}&cModNo={2}&cModName={3}")
    JSONObject addParam(String cProNo, String cProName, String cModNo, String cModName, @Header("Authorization") String ticket);

    @Get("http://172.18.100.157:8010/Product/GetProModsByCProNo?cProNo={0}&keyword={1}")
    JSONObject listParam(String cProNo, String keyword, @Header("Authorization") String ticket);

//    Common/GetProdutTypesDDL
    @Get("http://172.18.100.157:8010/Common/GetProdutTypesDDL")
    JSONObject getProductType( @Header("Authorization") String ticket);

    @Post("https://192.16.0.7:8001/en/002_1.1/login")
    JSONObject  getSession(@JSONBody Map map);

    @Post("http://172.18.10.241:8083/login/form")
    JSONObject getToken(@JSONBody Map map,@Header("Authorization") String ticket);
}